<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>    
   
<%!
    	public int A(){
    	return 2;
    }
    %> 
    
<%
//定义一个数组
int []a={1,5,6,9,8,7};
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>

<body>
<!--Html注释 -->
<%--JSp注释，浏览时不能看到 --%>

<% out.print(A()); %>
<%=A() %>

<%--输出数组 --%>
数组内容是：
<%
	for(int i=0;i<a.length-1;i++){
		%>
		<span style="color:#ffcccc"><%=a[i] %></span>
<% }%>		
	


</body>
</html>